/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.latesis.bean;

import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author user
 */
@Entity
@Table(name = "TBL_TARIFA")
public class TarifaBean {
    
    private Long id;    
    private ZonaBean zonaOrigen;    
    private ZonaBean zonaDestino;        
    private List<DetalleTarifaBean> detallesTarifa;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name="zonaOrigenId")
    public ZonaBean getZonaOrigen() {
        return zonaOrigen;
    }

    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name="zonaDestinoId")
    public ZonaBean getZonaDestino() {
        return zonaDestino;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy="tarifa")
    public List<DetalleTarifaBean> getDetallesTarifa() {
        return detallesTarifa;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setZonaOrigen(ZonaBean zonaOrigen) {
        this.zonaOrigen = zonaOrigen;
    }

    public void setZonaDestino(ZonaBean zonaDestino) {
        this.zonaDestino = zonaDestino;
    }

    public void setDetallesTarifa(List<DetalleTarifaBean> detallesTarifa) {
        this.detallesTarifa = detallesTarifa;
    }
    
}
